/* 
 * Copyright 2011 QDSS.org. All rights reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.qdss.oapi4j.base;

import org.apache.http.Header;
import org.qdss.oapi4j.Result;

/**
 * 结果集
 * 
 * @author <a href="mailto:zhaofang123@gmail.com">Zhao Fangfang</a>
 * @date 2011-3-20
 * @version $Id: BaseResult.java 15 2011-04-01 07:08:55Z zhaofang123@gmail.com $
 */
public abstract class BaseResult<T> implements Result<T> {
	
	private String result;
	private int invokeTime;
	private Header[] headers;
	
	/**
	 * @param result
	 */
	public BaseResult(String result) {
		this(result, 0, null);
	}
	
	/**
	 * @param result
	 * @param invokeTime
	 * @param headers
	 */
	public BaseResult(String result, int invokeTime, Header[] headers) {
		this.result = result;
		this.invokeTime = invokeTime;
		this.headers = headers;
	}
	
	public int getInvokeTime() {
		return invokeTime;
	}
	
	public Header[] getHeaders() {
		return headers;
	}
	
	/**
	 * 获取原始结果文本
	 * 
	 * @return
	 */
	public String getRawResult() {
		return result;
	}
}